using System.Xml.Schema;
using System.Xml.Serialization;
using System.Collections.Generic;

namespace SQLRunnerLib.Util
{
	/// <summary>
	/// Use to save user name/value application parameters in a XML file
	/// </summary>
	[XmlRoot(Namespace="", IsNullable=false)]
	public class RunnerProperties 
	{
        
		/// <remarks/>
		[XmlElement("Property", Form=XmlSchemaForm.Unqualified)]
		public List<RunnerProperty> Items;

		public RunnerProperties()
		{
			Items = new List<RunnerProperty>();
		}

		public RunnerProperty FindProperty(string name)
		{
			foreach (RunnerProperty property in Items)
			{
				if (property.name.Equals(name)) return property;
			}
			return null;
		}
	}
}